package io.geekidea.boot.shop.service.base.api;

import com.baomidou.mybatisplus.extension.service.IService;
import io.geekidea.boot.framework.page.Paging;
import io.geekidea.boot.shop.dto.AddressDto;
import io.geekidea.boot.shop.entity.Address;
import io.geekidea.boot.shop.query.app.AppAddressQuery;
import io.geekidea.boot.shop.query.web.AddressQuery;
import io.geekidea.boot.shop.vo.app.AppAddressVo;
import io.geekidea.boot.shop.vo.web.AddressVo;


/**
 * 收货地址 服务接口
 *
 * @author geekidea
 * @since 2024-10-27
 */
public interface AddressService extends IService<Address> {

    /**
     * 添加收货地址
     *
     * @param dto
     * @return
     * @throws Exception
     */
    boolean addAddress(AddressDto dto);

    /**
     * 修改收货地址
     *
     * @param dto
     * @return
     * @throws Exception
     */
    boolean updateAddress(AddressDto dto);

    /**
     * 删除收货地址
     *
     * @param id
     * @return
     * @throws Exception
     */
    boolean deleteAddress(Integer id);

    /**
     * 收货地址详情
     *
     * @param id
     * @return
     * @throws Exception
     */
    AddressVo getAddressById(Integer id);

    /**
     * 收货地址分页列表
     *
     * @param query
     * @return
     * @throws Exception
     */
    Paging<AddressVo> getAddressPage(AddressQuery query);

    /**
     * App收货地址详情
     *
     * @param id
     * @return
     * @throws Exception
     */
    AppAddressVo getAppAddressById(Integer id);

    /**
     * App收货地址分页列表
     *
     * @param query
     * @return
     * @throws Exception
     */
    Paging<AppAddressVo> getAppAddressPage(AppAddressQuery query);

    /**
     * 根据会员ID获取收货地址
     * @param id
     */
    Address getByMemberId(Long id);
}
